package org.mcjug.locationmailer.activity;

import java.util.List;

import org.mcjug.locationmailer.R;
import org.mcjug.locationmailer.model.template.TemplateItem;
import org.mcjug.locationmailer.model.template.TemplateItemContainer;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ArrayAdapter;

public class NoLocationEmailPreference extends AbstractEmailPreference {

    public NoLocationEmailPreference(Context ctxt) {
        this(ctxt, null);
    }

    public NoLocationEmailPreference(Context ctxt, AttributeSet attrs) {
        this(ctxt, attrs, 0);
    }

    public NoLocationEmailPreference(Context ctxt, AttributeSet attrs, int defStyle) {
        super(ctxt, attrs, defStyle);
    }

    @Override
    protected ArrayAdapter<String> getKeywordData() {

        List<String> labels = TemplateItemContainer.getLabels(TemplateItem.FLAG_NO_LOCATION, getContext());

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this.getContext(), R.layout.autocomplete_list_item,
                labels);

        return adapter;
    }
}
